<template>
  <div>
    <van-search v-model="value" placeholder="请输入搜索关键词" @keydown.enter="enter" />
      <div>
        <v-list :list="list"></v-list>
      </div>
  </div>
</template>

<script>
import {reqSearch} from "../../http/http"
export default {
  data(){
    return{
      value:"",//关键字
      list:[] //展示数组
    }

  },
  methods:{ 
    enter(){
      // 获取关键字 发请求  
      reqSearch({
       keywords:this.value
      }).then((res)=>{
        this.list=res.data.list?res.data.list:[]
        console.log(this.list);
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import "../../less/index.less";
.van-search{
  background:@primary;
}
.search{
margin:0.2rem ;
}
.title{
  font-size: .4rem;
  color: #ff4400;
  text-align: center;
}

</style>